
<%@page import="com.portlet.service.roleLocalServiceUtil"%>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@page import="java.util.*" %>
<%@page import="com.portlet.model.*"%>
<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>
<%@ taglib uri="http://alloy.liferay.com/tld/aui" prefix="aui" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page pageEncoding="UTF-8" %>
<portlet:defineObjects />

<h4>Quản lý vị trí trong công ty AnhKhoa Brother</h4>

<%
	int count=roleLocalServiceUtil.getrolesCount();
	List<role>list=roleLocalServiceUtil.getroles(0, count);
	if(list.size()>0){
%>
	<portlet:actionURL name="editRL" var="actionRLURL"></portlet:actionURL>
	<h4>Danh sách vị trí trong công ty</h4>
	<table border="1">
		<tr>
			<th>Mã Role</th>
			<th>Tên Role</th>
			<th>Ghi Chú</th>
			<th>Xóa</th>
		</tr>
		<%for (role l : list) { %>
		<tr>
			<td>
			<%
				String pk=String.valueOf(l.getMaRole());
			%>
				<aui:form action="<%=actionRLURL.toString() %>" method="post">
					<aui:input type="hidden" name="maRL" id="maRL" value="<%=l.getMaRole() %>"/>
					<aui:input type="submit" name="" value="<%=l.getMaRole() %>" />
				</aui:form>
				
			</td>
			<td><%=l.getTenRole() %></td>
			<td><%=l.getGhiChu() %></td>
			<td>
				<portlet:actionURL var="deleteURL" name="deleteRL">
					<portlet:param name="edit" value="<%=pk %>"/>
				</portlet:actionURL>
				<liferay-ui:icon-delete url="<%=deleteURL.toString() %>" />
			</td>
		</tr>
		<%} %>
	</table>
<%}else{ %>
	<h5>Không dữ liệu nào!!</h5>
<%} %>
<portlet:renderURL var="addRoleURL">
	<portlet:param name="mvcPath" value="/addRL.jsp"/>
</portlet:renderURL>
<portlet:renderURL var="addNVURL">
	<portlet:param name="mvcPath" value="/viewNV.jsp"/>
</portlet:renderURL>
<p>
	<a href="<%=addRoleURL%>">Thêm Vai trò</a>
	<a href="<%=addNVURL%>">Thêm nhân viên</a>
</p>